import { AirCity } from "./AirCity"
// importScripts("./ac.min43.js");
// importScripts("./test.js");
// Worker 模块状态管理
const Worker = {
    namespaced: true, //定义module另外命名时，需要在module中加一个命名空间namespaced: true属性，否则命名无法暴露出来，导致报[vuex] module namespace not found in mapState()等错误。
    state: {
        addWorker: null,
        deleteWorker: null,
        updataWorker: null,
    },
    mutations: {
        addWorker_mut(state, val) {
            console.log(AirCity.state,"api");
            state.addWorker = val
        },
        deleteWorker_mut(state, val) {
            state.deleteWorker = val
        },
        updataWorker_mut(state, val) {
            state.updataWorker = val
        },
    },
    actions:{
        addWorker_act({state}, arr) {
            state.addWorker.postMessage("add",[AirCity.state.AirCityApi])
        },
    }
}

export { Worker }

